<%@ page language="java" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> 

<jsp:useBean id="attachDetailView" scope="request" type="com.broadvision.web.util.ViewDynaBean"/> 
<bean:define id="filePath" name="attachDetailView" property="filePath"/>
<bean:define id="version" name="attachDetailView" property="version"/>
<bean:size id="parentSize" name="attachDetailView" property="parentList"/>

<form action="<html:rewrite page='<%="/download" + filePath %>'/>" target="download">
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<bean:message  bundle="appCommonRes"key="bp.content.attDetails"/>">
  <tr> 
  <td valign="top" width="100%">
		  
  <div class="pageTitle"><bean:message  bundle="appCommonRes" bundle="appCommonRes"key="bp.content.attDetails"/></div>
  
  <div class="pageSubtitle">
    <span class="left"><bean:message  bundle="appCommonRes"key="bp.content.attDetailInfo"/></span>
    <span class="right">&nbsp;</span>
  </div> 
  
	<div class="blockWrap">
  <form action="<html:rewrite page='<%="/download" + filePath %>'/>" target="download">          
  <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<bean:message  bundle="appCommonRes"key="bp.content.attDetails"/>">
    <tr>
      <td valign="top" width="25%" class="label"><bean:message  bundle="appCommonRes"key="bp.content.contentName"/>:</td>
      <td valign="top" class="labelField" width="75%">
      <logic:equal name="attachDetailView" property="viewAllowed" value="true">
       <bean:write name="attachDetailView" property="contentName"/>  <input type=submit value="<bean:message  bundle="appCommonRes"key="bp.content.viewAttachmentInside"/>"/>
      </logic:equal>
      <logic:equal name="attachDetailView" property="viewAllowed" value="false">
       <bean:write name="attachDetailView" property="contentName"/> 
      </logic:equal>
      </td
    </tr>
    <tr>
      <td valign="top" width="25%" class="label"><bean:message  bundle="appCommonRes"key="bp.content.version"/>:</td>
      <td valign="top" class="labelField" width="75%"><bean:write name="attachDetailView" property="version"/></td>
    </tr>
    <tr>
      <td valign="top" width="25%" class="label"><bean:message  bundle="appCommonRes"key="bp.content.type"/>:</td>
      <td valign="top" class="labelField" width="75%"><bean:write name="attachDetailView" property="contentObjectType"/></td>
    </tr>
    <tr>
      <td valign="top" width="25%" class="label"><bean:message  bundle="appCommonRes"key="bp.content.checkedOutBy"/>:</td>
      <td valign="top" class="labelField" width="75%"><bean:write name="attachDetailView" property="checkedOutBy"/></td>
    </tr>
    <tr>
      <td valign="top" width="25%" class="label"><bean:message  bundle="appCommonRes"key="bp.content.contentCreationDate"/>:</td>
<td valign="top" class="labelField" width="75%"><bean:write name="attachDetailView" property="objectCreatedTime"  formatKey="format.datetime.full"/></td>
    </tr>
    <tr>
      <td valign="top" width="25%" class="label"><bean:message  bundle="appCommonRes"key="bp.content.contentModificationDate"/>:</td>
      <td valign="top" class="labelField" width="75%"><bean:write name="attachDetailView" property="versionCreatedTime" formatKey="format.datetime.full"/></td>
    </tr>
  </table>
  </form>
	</div>	  
  <br>

  <div class="pageSubtitle">
    <span class="left"><bean:message  bundle="appCommonRes"key="bp.content.parentList" /></span>
    <span class="right">&nbsp;</span>
  </div>
  
	<div class="blockWrap">  
  <table class="dataTable" border="0" cellspacing="1" cellpadding="2" width="100%" summary="<bean:message  bundle="appCommonRes"key="bp.content.parentList"/>">
  <tr class="listHeader"> 
    <th id="Content Name" align="left"><bean:message  bundle="appCommonRes"key="bp.content.contentName"/></th>
    <th id="Version" align="left"><bean:message  bundle="appCommonRes"key="bp.content.version"/></th>
    <th id="Type" align="left" nowrap><bean:message  bundle="appCommonRes"key="bp.content.type"/></th>
    <th id="Modified on" align="left" nowrap><bean:message  bundle="appCommonRes"key="bp.content.modifiedOn"/></th>
    <th id="Modified by" align="left" nowrap><bean:message  bundle="appCommonRes"key="bp.content.modifiedBy"/></th>
    <th id="Checked out by" align="left" nowrap><bean:message  bundle="appCommonRes"key="bp.content.checkedOutBy"/></th>
    <th id="Process Instance" align="left" nowrap><bean:message  bundle="appCommonRes"key="bp.content.processInstance"/></th>
  </tr>

  <logic:equal name="attachDetailView" property="viewAllowed" value="false">
  <tr class="listEven"> 
    <td colspan="7" valign="top" align="center"><bean:message  bundle="appCommonRes"key="bp.content.notAllowedToViewParents"/></td>
  </tr>
  </logic:equal>   

  <logic:equal name="attachDetailView" property="viewAllowed" value="true">
  <logic:equal name="parentSize" value="0">
  <tr class="listEven"> 
    <td colspan="7" valign="top" align="center"><bean:message  bundle="appCommonRes"key="bp.content.noParentContentFound"/></td>
  </tr>
  </logic:equal>   

  <logic:iterate id="parent" name="attachDetailView" property="parentList" indexId="index">  
    <tr class='<%=index.intValue() %2 == 0 ? "listEven" : "listOdd"%>'>
      <td headers="Content Name" align="center">
       <html:link page="/contentDetail.do?action=search" name="parent" property="urlParams">
         <bean:write name="parent" property="contentName"/>
       </html:link>
      </td>
      <td headers="Version"><bean:write name="parent" property="version"/></td>
      <td headers="Type" align="center"><bean:write name="parent" property="contentObjectType"/></td>
      <td headers="Modified on"><bean:write name="parent" property="versionCreatedTime" formatKey="format.datetime.full"/></td>
      <td headers="Modified by"><bean:write name="parent" property="versionCreatedBy"/></td>
      <td headers="Checked out by" align="center"><bean:write name="parent" property="checkedOutBy"/></td>
      <td headers="Process Instance" align="center"><bean:write name="parent" property="processInstanceName"/>
      </td>
    </tr>
  </logic:iterate>
  </logic:equal>
  </table>
  </div>
  </td>
  </tr>
</table>  
